import { createRouter, createWebHashHistory } from 'vue-router'

// 页面
const Login = () => import("../views/Login.vue")

// 用户中心
const UserCenter = () => import("../views/user-center/Index.vue")
const UserProfile = () => import("../views/user-center/Profile.vue")
const UserSettings = () => import("../views/user-center/Settings.vue")


const routes = [
    {
        path: '/',
        redirect:'/login'
    },
    {
        path: '/login',
        name: 'login',
        component: Login
    },
    {
        path: '/user',
        name: 'userCenter',
        component: UserCenter,
        redirect: '/user/profile',
        children: [
            {
                path: 'profile',
                name: 'profile',
                component: UserProfile
            },
            {
                path: 'settings',
                name: 'settings',
                component: UserSettings
            },
        ]
    }
]


const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router